package com.dong.auth.security.oauth2;

import com.dong.common.Result;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * AuthorizationEndpoint
 *
 * @author zhaodongchao
 * @version V1.0
 * @date 2021/10/26 22:21
 */
@Controller
public class Oauth2Endpoint {

    /**
     * 获取授权码
     *
     * @param model      附加参数
     * @param parameters 请求参数
     */
    @GetMapping("/oauth/authorize")
    public Result<String> authorize(Map<String, Object> model, @RequestParam Map<String, String> parameters) {

        return null;
    }

    /**
     * 根据授权码获取token
     *
     */
    @PostMapping("/oauth/token")
    public Result<String> getToken(@RequestParam Map<String, String> parameters) {

        return null;
    }

    /**
     * 给定一个token，检查是否有效
     * @param value 待检查的token的值
     */
    @PostMapping("/oauth/check_token")
    public Result<String> checkToken(@RequestParam("token") String value){

        return null ;
    }
}
